/*
 * MHttpConnectionHandler.java
 *
 * Created on April 16, 2008, 9:18 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package uns.fit.gis.httpconnection;

/**
 *
 * @author pham hiep
 */
public interface MHttpConnectionHandler {
    /*
     * @param ERR_HTTP_COMPLETED The ERR_HTTP_COMPLETED is indicate that you are open connection successfull.
     */
    final static int ERR_HTTP_COMPLETED = 0;
    /*
     * @param ERR_HTTP_TIMEOUT The ERR_HTTP_TIMEOUT is indicate that you are open connection over timeout.
     */
    final static int ERR_HTTP_TIMEOUT = 1;
    /*
     * @param ERR_HTTP_FAIL The ERR_HTTP_FAIL is indicate that you are open connection failed.
     */
    final static int ERR_HTTP_FAIL = 2;
    
    /*
     * This function is used to receive data respond from server.
     * @param data[] The data[] is data responded from server when you are send request to server.
     * @param errorCode The errorCode is a status of the connection. Ex: 0 success, 1 timeout, 2 fail.
     * @param item The item have been open connection to server.
     * @return interger when finished this function.
     */
    public int HttpLoadCompleted(byte[] data, int errorCode, MHttpConnItem item);
}
